<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 交换两个变量
        // 1.需要一个临时变量作为中转
        var age = '红苹果'
        var age1 = '青苹果'
        var tmp//如果想让他全空 就直接 写变量不写赋值号
        tmp = age
        age = age1
        age1 = tmp
        console.log(age,age1);
    </script>
</head>

<body>

</body>

</html>